var app = getApp()
Page({
  data: {
    userInfo: {},
    // orderItems
    orderItems: [{
        typeId: 0,
        name: '待付款',
        url: 'bill',
        imageurl: '/assets/待付款(2)@2x.png',
      },
      {
        typeId: 1,
        name: '待发货',
        url: 'bill',
        imageurl: '/assets/待发货(2)@2x.png',
      },
      {
        typeId: 2,
        name: '已发货',
        url: 'bill',
        imageurl: '/assets/已收货@2x.png'
      },
      {
        typeId: 3,
        name: '待评价',
        url: 'bill',
        imageurl: '/assets/待评价(1)@2x.png'
      }
    ]
  },
  //事件处理函数
  toOrder: function() {
    wx.navigateTo({
      url: '../order/list/index'
    })
  },
  toAdd:function(){
    wx.navigateTo({
      url: '../address/list/index'
    })
  },
  toShoucang: function () {
    wx.navigateTo({
      url: '../shoucang/shoucang'
    })
  },
  toKaquan: function () {
    wx.navigateTo({
      url: '../kaquan/kaquan'
    })
  },
  toMyFoot: function () {
    wx.navigateTo({
      url: '../myFoot/myFoot'
    })
  },
  onLoad: function() {
    wx.setNavigationBarTitle({
      title: "个人中心"
    });
    console.log('onLoad')
    var that = this
    //调用应用实例的方法获取全局数据
    app.getUserInfo(function(userInfo) {
      //更新数据
      that.setData({
        userInfo: userInfo
      })
    })
  }
})